import 'package:dio/dio.dart';
import 'log.dart';

class LogInterceptors extends InterceptorsWrapper {
  @override
  onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    return handler.next(options);
  }

  @override
  onResponse(Response response, ResponseInterceptorHandler handler) {
    Log().insertNetWork(response);
    return handler.next(response);
  }

  @override
  onError(DioError err, ErrorInterceptorHandler handler) {
    Log().insertErrorNetWork(err);
    return handler.next(err);
  }
}
